<!DOCTYPE html>
<html>
	<head>
		<#include "/templates/commons/head.html">
		<script type="text/javascript">
			/**
			*点击查询按钮，查询操作日志信息列表
			*/
			function query(){
				if(!$("#opForm").validateForm()){
					return;
				}
				resetPageInfo();
				document.opForm.action = "${ctx!}/OperateLogController/queryList.do";
				document.opForm.submit();
			}

			/**
			*点击导出日志信息
			*/
			function exportOperateLog(){
				document.opForm.action = "${ctx!}/OperateLogController/exportOperateLog.do";
				document.opForm.submit();
			}
			
			/**
			*点击清空日志信息
			*/
			function deleteOperateLog(){
			    layer.confirm("您是否要清空？", {
				    	btn: ['确定', '取消']
					}, function() {
					    document.opForm.action = "${ctx!}/OperateLogController/deleteOperateLog.do";
						document.opForm.submit();
					}, function() {
				});
			}
			
			function ready() {
			    /* laydate.render({
					elem: '#test10',
					type: 'datetime',
					range: true
				}); */
			}
		</script>
	</head>
	<body>
		<div id="div-body" class="body">
			<form id="opForm" name="opForm" method="post" noValidateClass="true">
				<div class="search-head">
					<!-- 顶部搜索&按钮栏 Start -->
			        <blockquote class="layui-elem-quote">
						<!-- 头部右边搜索条件 Start -->
			            <div class="layui-form layui-list-btn-group">
		                	<div class="input-block">
			                	<!-- 操作类型 搜索 Start -->
			                    <label class="layui-form-label">操作类型</label>
			                    <div class="layui-input-inline">
			                        <select name="param_operateType">
										<option value="">-全部-</option>
			                        	<@dict type="operate_type">
			                        		<#if dictList??>
												<#list dictList as dict>
													<option value="${dict.code!}" <#if (Request.param_operateType?? && Request.param_operateType != "")>selected</#if>>${dict.name}</option>
												</#list>
			                        		</#if>
										</@dict>
									</select>
			                    </div>
			                    <!-- 操作类型 搜索 End -->
		                	</div>
		                	<div class="input-block">
			                	<!-- 操作日期 搜索 Start -->
			                    <label class="layui-form-label">操作日期</label>
			                    <div class="layui-input-inline">
			                    	<#if (Request.param_startDate?? && Request.param_startDate != '')>
			                    		<#assign var_beginDate = Request.param_startDate />
			                    	<#else>
			                    		<#assign var_beginDate = '' />
			                    	</#if>
									<input type="text" name="param_startDate" id="param_startDate" readonly="readonly" value="${var_beginDate}" placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" layuidate="true"/>
			                    </div>
			                    <!-- 操作日期 搜索 End -->
		                	</div>
		                	<div class="input-block">
			                	<!-- 操作日期 搜索 Start -->
			                    <label class="layui-form-label">至</label>
			                    <div class="layui-input-inline">
			                    	<#if (Request.param_endDate?? && Request.param_endDate != '')>
			                    		<#assign var_endDate = Request.param_startDate />
			                    	<#else>
			                    		<#assign var_endDate = '' />
			                    	</#if>
									<input type="text" name="param_endDate" id="param_endDate" readonly="readonly" value="${var_endDate}" placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" layuidate="true"/>
			                    </div>
			                    <!-- 操作日期 搜索 End -->
		                	</div>
			            </div>
			            <!-- 头部右边搜索条件 End -->
					</blockquote>
		        	<!-- 按钮 Start -->
			        <blockquote class="layui-elem-quote list-btn-group">
						<div class="layui-btn-group">
							<#if Session.CUR_MENU.exportRole == 1>
								<button class="layui-btn" type="button" onclick="exportOperateLog();"><i class="layui-icon">&#xe654;</i>导出</button>
							</#if>
							<#if Session.CUR_MENU.deleteRole == 1>
								<button class="layui-btn" type="button" onclick="deleteOperateLog();"><i class="layui-icon">&#xe640;</i>清空</button>
							</#if>
						</div>
						<#if Session.CUR_MENU.selectRole == 1>
							<button class="layui-btn query-btn layui-btn-danger" type="button" onclick="query();"><i class="layui-icon">&#xe615;</i>查询</button>
                        </#if>
			        </blockquote>
					<!-- 按钮 End -->
			        <!-- 顶部搜索&按钮栏End -->
				</div>
		        <!-- table list group Start -->
				<div id="container">
					<!-- message Start -->
		        	<div id="div-message">${message!}</div>
		        	<!-- message End -->
		        	<!-- table list Start -->
					<div class="data-grid-group">
						<table lay-filter="data-grid" class="layui-table dymanic-table">
							<thead>
								<tr>
									<th lay-data="{field:'index', align : 'center', width: '8%'}">序号</th>
									<th lay-data="{field:'menuName', align : 'center', width: '20%'}">菜单名称</th>
									<th lay-data="{field:'operateType', align : 'center', width: '12%'}">操作类型</th>
									<th lay-data="{field:'remark', align : 'center', width: '15%'}">操作描述</th>
									<th lay-data="{field:'opdate', sort: true, align : 'center', width: '15%'}">操作时间</th>
									<th lay-data="{field:'operator', align : 'center', width: '10%'}">操作人</th>
									<th lay-data="{field:'operatorid', align : 'center', width: '10%'}">操作人帐号</th>
									<th lay-data="{field:'ip', align : 'center', width: '10%'}">IP</th>
								</tr>
							</thead>
							<tbody>
								<#if list??>
									<#list list as OperateLogBean>
										<tr>
											<td>${OperateLogBean_index + 1}</td>
											<td>${OperateLogBean.menuName!'-'}</td>
											<td>${OperateLogBean.operateType!'-'}</td>
											<td>${OperateLogBean.remark!'-'}</td>
											<td>${OperateLogBean.opdate!'-'}</td>
											<td>${OperateLogBean.operator!'-'}</td>
											<td>${OperateLogBean.operatorid!'-'}</td>
											<td>${OperateLogBean.ip!'-'}</td>
										</tr>
									</#list>
								</#if>
							</tbody>
						</table>
						<!-- 分页 Start -->
						<div class="page-helper">
							<#include "/templates/commons/page.html">
						</div>
						<!-- 分页 End -->
					</div>
					<!-- table list End -->
				</div>
				<!-- table list group End -->
			</form>
		</div>
	</body>
</html>